<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>bridge</title>
    <link rel="icon" href="./favicon.ico" type="image/x-icon">
    <link rel="shortcut icon" href="./favicon.ico" type="image/x-icon">
    <style>
        h2{
            width: 100%;
            text-align: center;
            margin-top: 20px;
        }
    </style>
</head>
<body>
    <h2>bridge 前端方法库</h2>
    <button onclick="down()">按钮</button>
</body>
</html>
<script src="./com.bridge.js"></script>
<script>
    console.log(bridgeFun, '本次编译 JS 方法');
    // console.log(bridgeFun.fun_saveImage(), 'cccccc');


    function down(selector, name) {
        // 生成一个a元素
        var a = document.createElement('a')
        // 将a的download属性设置为我们想要下载的图片名称
        a.download = name || 'pic'
        // 将生成的URL设置为a.href属性
        a.href = './favicon.ico'
        // 触发a的单击事件
        a.click();
    }
</script>
